/*
 * Helpers.cpp
 *
 *  Created on: Jan 14, 2011
 *      Author: kmueller
 */

#include "Helpers.h"

#include <QGeoCoordinate>
#include <QtCore>

using namespace QtMobility;

LabeledCoordinate::LabeledCoordinate() :
	QtMobility::QGeoCoordinate() {

}

LabeledCoordinate::LabeledCoordinate(const QString& name,
		const QGeoCoordinate& coord) :
	QGeoCoordinate(coord) {
	setLabel(name);
}

LabeledCoordinate::LabeledCoordinate(const LabeledCoordinate& other) :
	QGeoCoordinate() {
	setLabel(other.getLabel());
	setAltitude(other.altitude());
	setLatitude(other.latitude());
	setLongitude(other.longitude());
}

QString LabeledCoordinate::getLabel() const {
	return label;
}

void LabeledCoordinate::setLabel(const QString& l) {
	label = l;
}
void LabeledCoordinate::setCoordinate(const QGeoCoordinate& coord) {
	setAltitude(coord.altitude());
	setLatitude(coord.latitude());
	setLongitude(coord.longitude());
}

bool LabeledCoordinate::operator==(const LabeledCoordinate& compare) const{
	return getLabel() == compare.getLabel()
//			&& altitude() == compare.altitude()
			&& latitude() == compare.latitude()
			&& longitude() == compare.longitude();
}
